import Todo from '../views/todo/todo.vue'
import Login from '../views/login/Login.vue'
import B from '../views/login/B.vue'
import A from '../views/login/A.vue'
import Home from '../views/login/Home.vue'
export default [
  {
    path: '/',
    redirect: '/app'
  },
  {
    path: '/app/:id',
    // props: (route) => ({ id: route.query.b }),
    component: Todo,
    name: 'app'
  },
  {
    path: '/login/:id',
    component: Login,
    children: [
      { path: '', component: Home },
      {
        // 当 /user/:id/profile 匹配成功，
        // UserProfile 会被渲染在 User 的 <router-view> 中
        path: 'B',
        component: B
      },
      {
        // 当 /user/:id/posts 匹配成功
        // UserPosts 会被渲染在 User 的 <router-view> 中
        path: 'A',
        component: A
      }
    ]
  }
]
